package command;

import elements.Robot;

/**
 * A class of basic command.
 *   A basic command does not involve any operators. It
 *   can be executed without any computations given a robot to execute it on.
 *    
 * @version	3.0
 * @author 	Lies Tambeur 	r0264469	2Bcwsbbh
 * @author	Eline Vanrykel	r0264543	2Bcwselt
 * 
 */
public abstract class BasicCommand extends Command {

	@Override
	public void setAlreadyExecuted(boolean alreadyExecuted){
		this.alreadyExecuted = alreadyExecuted;
	}
	
	@Override
	public boolean executeSingleStep(Robot robot){
		if(!this.isAlreadyExecuted()){
			this.execute(robot);
			this.setAlreadyExecuted(true);
			return true;
		}
		return false;
	}
}
